package com.hansheng.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by GoldenMan on 2017/7/8.
 */
@Entity
@Table(name = "out_detail", schema = "hansheng")
public class OutDetailEntity {
    private int outDetailId;
    private Integer outId;
    private String cutMaterialFormNo;
    private Integer sid;
    private Integer length;
    private Integer width;
    private Integer height;
    private Integer count;
    private Double weightThe;
    private Double weightAct;
    private Timestamp addTime;
    private int status;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "out_detail_id", nullable = false)
    public int getOutDetailId() {
        return outDetailId;
    }

    public void setOutDetailId(int outDetailId) {
        this.outDetailId = outDetailId;
    }

    @Basic
    @Column(name = "out_id", nullable = true)
    public Integer getOutId() {
        return outId;
    }

    public void setOutId(Integer outId) {
        this.outId = outId;
    }

    @Basic
    @Column(name = "cut_material_form_no", nullable = true, length = 255)
    public String getCutMaterialFormNo() {
        return cutMaterialFormNo;
    }

    public void setCutMaterialFormNo(String cutMaterialFormNo) {
        this.cutMaterialFormNo = cutMaterialFormNo;
    }

    @Basic
    @Column(name = "sid", nullable = true)
    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    @Basic
    @Column(name = "length", nullable = true)
    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    @Basic
    @Column(name = "width", nullable = true)
    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    @Basic
    @Column(name = "height", nullable = true)
    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    @Basic
    @Column(name = "count", nullable = true)
    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    @Basic
    @Column(name = "weight_the", nullable = true, precision = 0)
    public Double getWeightThe() {
        return weightThe;
    }

    public void setWeightThe(Double weightThe) {
        this.weightThe = weightThe;
    }

    @Basic
    @Column(name = "weight_act", nullable = true, precision = 0)
    public Double getWeightAct() {
        return weightAct;
    }

    public void setWeightAct(Double weightAct) {
        this.weightAct = weightAct;
    }

    @Basic
    @Column(name = "add_time", insertable = false, updatable = false, nullable = false)
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "status", nullable = false)
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OutDetailEntity that = (OutDetailEntity) o;

        if (outDetailId != that.outDetailId) return false;
        if (status != that.status) return false;
        if (outId != null ? !outId.equals(that.outId) : that.outId != null) return false;
        if (cutMaterialFormNo != null ? !cutMaterialFormNo.equals(that.cutMaterialFormNo) : that.cutMaterialFormNo != null)
            return false;
        if (sid != null ? !sid.equals(that.sid) : that.sid != null) return false;
        if (length != null ? !length.equals(that.length) : that.length != null) return false;
        if (width != null ? !width.equals(that.width) : that.width != null) return false;
        if (height != null ? !height.equals(that.height) : that.height != null) return false;
        if (count != null ? !count.equals(that.count) : that.count != null) return false;
        if (weightThe != null ? !weightThe.equals(that.weightThe) : that.weightThe != null) return false;
        if (weightAct != null ? !weightAct.equals(that.weightAct) : that.weightAct != null) return false;
        if (addTime != null ? !addTime.equals(that.addTime) : that.addTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = outDetailId;
        result = 31 * result + (outId != null ? outId.hashCode() : 0);
        result = 31 * result + (cutMaterialFormNo != null ? cutMaterialFormNo.hashCode() : 0);
        result = 31 * result + (sid != null ? sid.hashCode() : 0);
        result = 31 * result + (length != null ? length.hashCode() : 0);
        result = 31 * result + (width != null ? width.hashCode() : 0);
        result = 31 * result + (height != null ? height.hashCode() : 0);
        result = 31 * result + (count != null ? count.hashCode() : 0);
        result = 31 * result + (weightThe != null ? weightThe.hashCode() : 0);
        result = 31 * result + (weightAct != null ? weightAct.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + status;
        return result;
    }
}
